import request from '@/utils/request.js'
// 获得部门列表
export const getDepartmentsAPI = () => {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
// 删除部门
export function delDepartmnetAPI(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
// 添加部门
export function addDepartmnetAPI(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 根据id查询部门信息
export function getDepartmnetByidAPI(id) {
  return request({
    url: '/company/department/' + id,
    method: 'get'
  })
}
// 根据id 编辑部门
export function updataDepartmnetByidAPI(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}
